<?php

namespace app\common\validate;

use think\Validate;

class Bus extends Validate
{
    protected $rule = [
        "account" => "require|unique:bus", 
        "nickname" => "require", 
        "pass" => "require|min:6",
        "passwords" => "require|confirm:pass",
        "phone" => "require|mobile|unique:bus",
        "service_charge" => "require|number",
        "margin" => "require|number",
        "avatar" => "require", 
        "address" => "require", 
    ];

    protected $message = [
        // "account.require" => "请输入账号",    
        // "account.unique" => "该账号已经存在",  

        "nickname.require" => "请输入昵称",  

        "pass.require" => "请输入密码", 
        "pass.min" => "密码必须大于6位数", 
        "passwords.require" => "请重复确认密码",
        "passwords.confirm" => "两次输入的密码不一致",

        "phone.require" => "手机号不可以为空", 
        "phone.mobile" => "手机号格式错误", 
        "phone.unique" => "该手机号已经存在",  

		"margin.require" => "请输入保证金",
		"margin.number" => "保证金设置必须要是数字",

		"service_charge.require" => "请输入服务费",
		"service_charge.number" => "服务费设置必须要是数字",

        "avatar.require" => "请上传logo",  
        "address.require" => "请选择地址", 
	
    ];

    protected $scene = [
        'add' => ['nickname','address'],
        'edit' => ['nickname','store_cash','rider_cash'],
        'pass' => ['password','passwords'],
        'login'  =>  ['pass'],
        'mobile_password_login' => ['pass'],
    ];
}
